import { worldServerConfMap } from "./ServerCloudConfig";
import { WorldServer } from "./WorldServer/WorldServer";


const worldServerId = process.env['SID'] || '1';

let conf = worldServerConfMap.get(worldServerId);
if(!conf){
    throw Error('can not find conf of SID=' + worldServerId);
}

export const worldServer = new WorldServer(conf);

// Entry function
async function main() {
    await worldServer.init();
    await worldServer.start();
}
main();